package com.yuteng.commons.handle;


import com.yuteng.commons.response.ResponseData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


/**
 * @version 1.0
 * @author： 余腾
 * @date： 2021-10-22 14:34
 */
@RestControllerAdvice
public class CommonExceptionHandler {


    @ExceptionHandler(Exception.class)
    public ResponseData commonExceptionHandler(Exception e) {
        e.printStackTrace();
        return ResponseData.error(e.getMessage());
    }
}
